package com.zyf.springboot.mapper;

import com.zyf.springboot.entity.Bookinfor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface BookinforMapper {
    @Select("select * from bookinfor")
    public List<Bookinfor> selectBookInfor();
    @Select("select * from bookinfor where book_name like '%${bookName}%'")
    public Bookinfor selectBookInforByName(String bookName);
    @Update("update bookinfor set state=#{state} where book_name=#{bookName}")
    public void updateBook(@Param("bookName") String bookName,@Param("state") int state);
}
